package com.open.ssm.oss;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;

/**
 * 阿里云OSS配置
 *
 * @version: v1.0.0
 * @author: wangpf
 * @date: 2022年5月27日 下午3:02:52
 */
@Configuration
public class OSSClientConfig {
	
	@Value("${aliyun.oss.endpoint}")
	private String endpoint;
	
	@Value("${aliyun.oss.accessKeyId}")
	private String accessKeyId;
	
	@Value("${aliyun.oss.accessKeySecret}")
	private String accessKeySecret;
	
	@Value("${aliyun.oss.bucketName}")
	private String bucketName;
	
	@Bean
	public OSS ossClient() {
		OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
		return ossClient;
	}

}
